blob: b3795acb05c65a44b3959cd97768f55ea4f71d31 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
import { error, redirect } from '@sveltejs/kit';
import { auth, post } from '$lib/utils';
export async function load({ cookies, locals, params }) {
let { user } = locals;
if (user) {
try {
await post('/redeem', params, auth(cookies));
} catch (e) {
throw redirect(307, '/');
}
throw redirect(307, `/${user.username}/transactions`);
}
throw redirect(307, '/login');
}
|